package cn.edu.scau.cmi.zhaotingjie.chapter06;

public class Example6_9 {
	public static void main(String args[]) {
		D b = new D();
		int sum = b.sum(30,20);
		int sub = b.sub(30,20);
		System.out.println("sum="+sum);
		System.out.println("sum="+sub);
	}
}

abstract class C{
	abstract int sum(int x,int y);
	int sub(int x,int y) {
		return x-y;
	}
}

class D extends C{
	int sum(int x,int y) {
		return x+y;
	}
}